package ${controllerPackageName};
import ${modelClassName};
import ${serviceClassName};
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.xiecang.model.dto.MsgBean;
import java.util.List;

/**
 *  ${note} 控制层
 *  @author ${author}
 */

@RestController
@RequestMapping("/mobile/${className?uncap_first}")
public class ${className}${controller?cap_first}${impl?cap_first} {

	@Autowired
	private ${className}${service?cap_first} ${className?uncap_first}${service?cap_first};

	/**
	 * 获取${note}列表信息
	 * @Param currentPage 当前页
	 * @Param pageSize 每页大小
	 *
	 */
	@RequestMapping(value = "/list" , method = { RequestMethod.GET })
	public MsgBean list(@RequestParam("currentPage") Integer currentPage,
		@RequestParam("pageSize") Integer pageSize){
		
		return ${className?uncap_first}${service?cap_first}.queryEntityList(currentPage,pageSize);
	}
	
	/**
	 *
	 * 保存${note}信息
	 * @Param ${className} 对象信息{@link ${modelPackgeName}}
	 *
	 */
	@RequestMapping(value = "/save" , method = { RequestMethod.POST })
	public MsgBean save(${className} ${className?uncap_first}){
		return ${className?uncap_first}${service?cap_first}.saveEntity(${className?uncap_first});
	}
	
	/**
	 *
	 * 更新${note}信息
	 * @Param ${className} 对象信息{@link ${modelPackgeName}}
	 * @return
	 * 
	 */
	@RequestMapping(value = "/update" , method = { RequestMethod.POST })
	public MsgBean update(${className} ${className?uncap_first}){
		return ${className?uncap_first}${service?cap_first}.updateEntity(${className?uncap_first});
	}
	
	/**
	 *
	 * 删除${note}信息
	 * @Param ${className} 对象信息{@link ${modelPackgeName}}
	 * @return 
	 *
	 */
	@RequestMapping(value = "/del" , method = { RequestMethod.POST })
	public MsgBean del(@RequestParam("id") Long id){
		return ${className?uncap_first}${service?cap_first}.delEntity(id);
	}
}